/************************************************************************/
/* @file            gxType.h                                            */
/* @brief           Basic type define for cross platform                */
/* @version         2013.11.14 johnxguo created                         */
/************************************************************************/

#ifndef __GX_TYPE_H_INCLUDED__
#define __GX_TYPE_H_INCLUDED__

#include <stdio.h>
#include "gxPlatform.h"

#ifdef interface
#undef interface
#endif
#define interface struct

namespace gx
{
#ifdef _GX_WINDOWS_

typedef unsigned __int8  u8;
typedef __int8           s8;
typedef unsigned __int16 u16;
typedef __int16          s16;
typedef unsigned __int32 u32;
typedef __int32          s32;

#define swprintf swprintf_s
#define snprintf snprintf_s

#else

typedef unsigned char    u8;
typedef signed char      s8;
typedef unsigned short   u16;
typedef signed short     s16;
typedef unsigned int     u32;
typedef signed int       s32;

#define swprintf _snwprintf
#define snprintf _snprintf

#endif

#if defined(_GX_WINDOWS_)
typedef unsigned __int64                    u64;
typedef          __int64                    s64;
#elif __GNUC__
#if __WORDSIZE == 64
typedef unsigned long int 			        u64;
typedef long int 			    	        s64;
#else
__extension__ typedef unsigned long long	u64;
__extension__ typedef long long	            s64;
#endif
#else
typedef unsigned long long			        u64;
typedef long long			                s64;
#endif

typedef char			 c8;
typedef float            f32;
typedef double           f64;

}// end namespace gx

#endif